import request from '@/utils/request'
import {parseStrEmpty} from "@/utils/lanling";

// 查询列表
export function listChannel(query) {
  return request({
    url: '/system/app/channel/page',
    method: 'get',
    params: query
  })
}

export function channelList(query) {
  return request({
    url: '/system/app/channel/list',
    method: 'get',
    params: query
  })
}

// 查询详细
export function getChannel(id) {
  return request({
    url: '/system/app/channel/' + parseStrEmpty(id),
    method: 'get'
  })
}

// 新增
export function addChannel(data) {
  return request({
    url: '/system/app/channel',
    method: 'post',
    data: data
  })
}

// 修改
export function updateChannel(data) {
  return request({
    url: '/system/app/channel',
    method: 'put',
    data: data
  })
}

// 状态修改
export function changeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/system/app/channel/changeStatus',
    method: 'put',
    data: data
  })
}

// 删除
export function delChannel(id) {
  return request({
    url: '/system/app/channel/' + id,
    method: 'delete'
  })
}


